home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-01-11 | 4.2 KB | 164 lines | [TEXT/CWIE] |
- /*
- -----BEGIN PGP SIGNED MESSAGE-----
-
- HttpServer Macintosh OpenTransport Network Server shell
-
- Version: early but functional
-
- Apple Macintosh Developer Technical Support
- Written by: Vinne Moscaritolo
-
- Copyright (work in progress) Apple Computer, Inc
-
- You may incorporate this sample code into your applications without
- restriction, though the sample code has been provided "AS IS" and the
- responsibility for its operation is 100% yours. However, what you are
- not permitted to do is to redistribute the source as "DSC Sample Code"
- after having made changes. If you're going to re-distribute the source,
- we require that you make it clear in the source that the code was
- descended from Apple Sample Code, but that you've made changes.
-
- HttpServer is a MacOS faceless background task that can be used as framework
- for developing connection based OpenTransport network servers. Written in
- Metrowerks C++, the HttpServer utilizes the Thread Manager, OpenTransport,
- AppleEvents (barely) and C++ IOStreams.
-
- The current example will bind onto TCP port 80 (HTTP) and listen for incoming
- connection requests, It will then spawn the connetion to another thread which
-
- can process it independantly.. To test, make sure your TCP/IP is up and
- running,
- then launch the app into the background and a access it with a web browser
- (Netscape,Cyerdog or whatever) and it will return you a test page
- for example my test node was 17.203.21.76 so I entered int netscape..
-
- http://17.203.21.76
-
- and I got back.
-
- - ------
- Vinnie's OpenTransport HTTP Test Server
-
- Server Info:
- Name: Mr Mojo Risin
- Date: Fri, 12 Jan 1996 01:10:59 GMT
- Active Sessions: 1
- Free: 3
- Accepted: 0
- Rejected: 0
- Up Time: 0 min
- Client: 17.203.21.75 :1102
- StackSpace: 23036
-
- Provider: 0
- Address: 17.203.21.76
- NetMask: 255.255.252.0
- Broadcast: 0.0.0.0
- Gateway: 17.203.20.1
- DNS: 17.203.21.76
- Domain: apple.com
- Port 0
- Name: serialA
- Bus: Serial Devices
- Module: serialAB
- Bus: MthrBrd
- Flags: TPI Can-Yield
- - ------
-
-
- Some of the techniques demonstrated in this sample are:
- - - Faceless Background Tasks
- - - Thread Manager
- - - OpenTransport connection management
- - - OpenTransport Async Notifer managemnt
- - - No-Copy network reads
- - - IOStreams managment
-
-
- There are a few key things that needs to be done
- - - Properly handle XTL LISTEN/ACCEPT Handoff ( I know..this s what you all
- want)
- - - IOStream extraction support (means reading from the stream) and Thread
- suspend/resume
- - - more support for Transport independant I/O
-
-
- here is my detailed list..
-
- main -
- - - notifier for error handler
-
- TContext
- - - proper support for execptions
-
- THTTServer
- - - remove uneccessary construct.destruct
- - - scan availablle providers to open on
- - - It wold be cool if THTTPSession::Run actally parsed html
-
- TBackroundApp
- - - A start stop erver event would be cool
-
- TNetworkAcceptor
- - - Listen/Accept and OTLook support
- - - Provideer will close event
- - - shutdown msg
- - - stream in prefs (TSessionPref)
- - - OptionManagement reuse IP ?
-
- TNetworkSession
- - - timeout event/watchdog
- - - handle out of sequence TDATA befor TPASSCON
-
- TNetworkStream
- - - write code for istream functions, support yield/suspend/resume thread
-
- TNetworkEndpointDescriptor
- - - setup options
- - - adverstise service
- - - make compatible with future OT tranparent stuff (whatch this space, it will
- be cool)
- - - write TServicedescriptor
-
- TAddrInet
- TAddr
- - - complete functionality
-
- TGMT
- - - stream in date/time
-
- - ---------------------------
-
- I know that this code really requires some real documention but I wanted to
- make
- it available as soon as I can, I will periodicaly post updates on various
- places
- on the net, you can also contact me to find out where.
-
- I was last able to compile it under CW7.
-
- good luck
-
- - -------------
- Vinnie Moscaritolo
- Apple DTS Sniper
- "One Shot..One Kill"
-
- http://webstuff.apple.com/~vinnie/
-
- Fingerprint = 4F A3 29 81 50 E4 04 F2 78 25 01 87 6E A2 14 6A
- - --------------
-
- -----BEGIN PGP SIGNATURE-----
- Version: 2.6.2
-
- iQCVAwUBMPW31/MF2+rAU+UdAQGX/AQAjvd4fN6guD2w3+FgCcLzrg2tWM2oNLiP
- Cbnq23EUo8K97k+F0QKdyqiWci4HPuTNtxYqZK2DPLkIylFuevMDgVcGTsZVbK/V
- PjrRwc1jUSRYMB61IRnbqJ/aiK7Huyp+WgwFnjk5oY03S7XwJV6HasDR2rz2Kxn7
- XVrq9fm9i+0=
- =rWY/
- -----END PGP SIGNATURE-----
-
-
-
- */